package com.corecloud.controller.statisticalCenter;

import com.corecloud.entity.statisticalCenter.SchoolGradationEntity;
import com.corecloud.service.statisticalCenter.StatisticalSchoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.security.Principal;
import java.util.List;

@RequestMapping("/statisticalSchool")
@Controller
public class StatisticalSchoolController {
    @Autowired
    private StatisticalSchoolService statisticalSchoolService;

    // 学校层次统计na
    @RequestMapping("/schoolGradationYears")
    @ResponseBody
    public List<SchoolGradationEntity> schoolGradationYears(Principal principal, SchoolGradationEntity info){
        List<SchoolGradationEntity> schoolGradationEntities = statisticalSchoolService.schoolGradationYears(info);
        return schoolGradationEntities;
    }

    // 学校层次统计（按地市）
    @RequestMapping("/schoolGradationArea")
    @ResponseBody
    public List<SchoolGradationEntity> schoolGradationArea(Principal principal,SchoolGradationEntity info){
        List<SchoolGradationEntity> schoolGradationEntities = statisticalSchoolService.schoolGradationAreas(info);
        return schoolGradationEntities;
    }
}
